package br.livro.cap6.layouts;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Menu extends ListActivity{
	
	private static final String[] opcoes = new String[]{"FrameLayout - Wrap",
		"FrameLayout - Fill","FrameLayout - ImagemFill", 
		"LinearLayout Horizontal","LinearLayout Vertical",
		"LinearLayout Gravity","LinearLayout Form Weight","Sair"	
	};
	
	@Override
	public void onCreate(Bundle icicle){
		super.onCreate(icicle);
		setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,opcoes));
	}

	@Override
	public void onListItemClick(ListView l, View v, int position, long id){
		super.onListItemClick(l,v,position,id);
		Intent it;
		switch(position){
			case 0:
				it = new Intent(this,TelaFrameLayoutWrapContentImg.class);
				it.putExtra("num", 1);
				startActivity(it);
				break;
			case 1:
				it = new Intent(this,TelaFrameLayoutWrapContentImg.class);
				it.putExtra("num", 2);
				startActivity(it);
				break;
			case 2:
				it = new Intent(this,TelaFrameLayoutWrapContentImg.class);
				it.putExtra("num", 3);
				startActivity(it);
				break;
			case 3:
				it = new Intent(this,TelaFrameLayoutWrapContentImg.class);
				it.putExtra("num", 4);
				startActivity(it);
				break;
			case 4:
				it = new Intent(this,TelaFrameLayoutWrapContentImg.class);
				it.putExtra("num", 5);
				startActivity(it);
				break;
			case 5:
				it = new Intent(this,TelaFrameLayoutWrapContentImg.class);
				it.putExtra("num", 6);
				startActivity(it);
				break;
			case 6:
				it = new Intent(this,TelaFrameLayoutWrapContentImg.class);
				it.putExtra("num", 7);
				startActivity(it);
				break;
			default:
				finish();
		}
	}
}
